package com.sinoglobal.sinostore.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.sinoglobal.sinostore.R;
/**
 * 
* @title: RefundDialog.java 
* @package com.chiliring.sinostore.dialog 
* @description: 退款退货的dialog
* @author zrh
* @date 2015年1月20日 上午10:07:04
 */
public class RefundDialog extends Dialog implements android.view.View.OnClickListener {

	private Listener listener;
	private String telNum;
	private Button btnCall;
	private TextView tvTel;
	
    public void setTellNum(String telNum) {
		this.telNum = telNum;
	}
    public String getTelNum() {
		return telNum;
	}
	public void setCancelable(boolean cancelable) {
		this.setCanceledOnTouchOutside(cancelable);
	}
	public void setListener(Listener myDialogListener) {
		this.listener = myDialogListener;
	}

	public RefundDialog(Context context) {
		super(context, R.style.alert_dialog);
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.shop_dialog_refund);
		init();
	}

	public void init() {
		tvTel=(TextView) findViewById(R.id.tvTell);
		btnCall=(Button) findViewById(R.id.btnCall);
		tvTel.setText(telNum);
		btnCall.setOnClickListener(this);
		View ivClose=findViewById(R.id.ivClose);
		ivClose.setOnClickListener(this);
	}

	public static interface Listener {
		void btnCallClick();
	}

	@Override
	public void onClick(View v) {
		dismiss();
		int id = v.getId();
		if (id == R.id.btnCall) {
			if (listener!=null) {
				listener.btnCallClick();
			}
		} else if (id == R.id.ivClose) {
		} else {
		}
	}
}
